/**
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2023-12-27 10:09:16
 * @Description  : 一些系统常量
 */
const FIVE_MINUTES = 60 * 5
const TEN_MINUTES = 2 * FIVE_MINUTES
const HALF_HOUR = 3 * TEN_MINUTES
const ONE_HOUR = 2 * HALF_HOUR
const ONE_DAY = 24 * ONE_HOUR
const FILE_FORMAT = 'YYYYMMDD_HHMMSS'
const SEPARATE_CHAR = ','
const PWD_LEVEL = 'pwdLevel'
const DATE_FORMAT_ARR = [
  'YYYY-MM-DD HH:mm:ss',
  'YYYY/MM/DD HH:mm:ss',
  'YYYY.MM.DD HH:mm:ss',
  'DD/MM/YYYY HH:mm:ss',
  'MM/DD/YYYY HH:mm:ss',
  'M DD,YYYY HH:mm:ss',
  'DD M,YYYY HH:mm:ss'
]
const ONE_KB = 1024
const ONE_MB = 1024 * 1024
const ONE_GB = 1024 * 1024 * 1024
const YES = 0
const NO = 1

// 验证码的应用业务类型
const businessTypes = [
  {
    type: 'register',
    subject: '注册验证码',
    needToken: false,
    needExist: false
  },
  { type: 'login', subject: '登录验证码', needToken: false, needExist: true },
  {
    type: 'findPwd',
    subject: '找回密码验证码',
    needToken: false,
    needExist: true
  },
  {
    type: 'bindEmail',
    subject: '绑定邮箱验证码',
    needToken: true,
    needExist: false
  }
]

module.exports = {
  FIVE_MINUTES,
  TEN_MINUTES,
  HALF_HOUR,
  ONE_HOUR,
  ONE_DAY,
  FILE_FORMAT,
  SEPARATE_CHAR,
  PWD_LEVEL,
  DATE_FORMAT_ARR,
  ONE_KB,
  ONE_MB,
  ONE_GB,
  YES,
  NO,
  businessTypes
}
